package indi.gao;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.List;

/**
 * <p>Description:</p>
 * <p>Copyright: Copyright (c)2019$</p>
 * <p>Company: Tope</p>
 * <P>Created Date :2019$-09$-03$</P>
 * <P>@version 1.0</P>
 */
public class JsonToObject {
    public static void main(String[] args) {
        String json = "{\"isSuppositionalGoods\":1,\"inspectionRatioMin\":0.0,\"isCombination\":0,\"judgeInventoryBalance\":0,\"productID\":2021686411,\"inStoreShelfDays\":0,\"isActive\":1,\"saleUnit\":\"斤\",\"productName\":\"测试快速新增1\",\"pluCode\":\"\",\"rateValue\":0.0,\"orderedMultiple\":1.0,\"semiProducts\":0.0,\"storeWay\":0,\"isCosted\":0,\"action\":0,\"isSuite\":1,\"id\":116,\"saleUnitType\":\"1\",\"barcode\":\"\",\"isOrdered\":1,\"checkedWay\":3,\"brandName\":\"\",\"isProcesed\":0,\"shipperID\":0,\"groupID\":11280,\"outputtaxValue\":0.0,\"isAllowReturned\":1,\"shipperName\":\"\",\"consumeCentage\":1.0,\"isNecessary\":0,\"isUsed\":0,\"productDesc\":\"10kg/箱子\",\"isUsedOrder\":1,\"grade\":\"\",\"inspectionRatioMax\":0.0,\"shelfDays\":0,\"isSale\":true,\"extfield2\":\"\",\"subjectCode\":1,\"extfield3\":\"\",\"dosage\":0.0,\"sortIndex\":0,\"singleMinOrdered\":1.0,\"remark\":\"tesg\",\"isBatch\":1,\"outStoreShelfDays\":0,\"isMallSuppositional\":false,\"brandID\":\"\",\"isWeigh\":true,\"mallCategoryID\":0,\"dutyCategoryCode\":\"\",\"singleMaxOrdered\":1.0,\"assistUnitName\":\"\",\"categoryID\":92734222,\"isNeedPay\":0,\"outputtaxID\":0,\"risCategoryID\":0,\"suiteIDs\":\"\",\"productImgPath\":\"\",\"sNCode\":1,\"ulLimitStockMin\":12.0,\"warnDays\":0,\"isUsedCostCard\":0,\"isReturnReverse\":1,\"isShelfLife\":0,\"standardUnit\":\"斤\",\"convertRatio\":0,\"rateID\":0,\"isRis\":false,\"procesAlias\":\"\",\"productMnemonicCode\":\"csksxz;ce;shi;kuai;su;xin;zeng;ceshikuaisuxinzeng\",\"yieldRate\":0.0,\"ulLimitStockMax\":100.0,\"productCode\":\"070101019\",\"isInStorage\":1,\"createTime\":1615974191573,\"unitper\":1.0,\"isValidChecked\":0,\"isProxyGoods\":0,\"extfield\":\"\",\"isMall\":false,\"isSemifinished\":0}";
//        List<MasterGoods> masterGoods1 = JSONObject.parseArray(jsonList, MasterGoods.class);
//        // jsonObject to Object
//        JSONObject jsonObject = JSON.parseObject(json);
//        MasterGoods masterGoods2 = jsonObject.toJavaObject(MasterGoods.class);
        MasterGoods masterGoods = JSONObject.parseObject(json, MasterGoods.class);
        System.out.println(JSONObject.toJSONString(masterGoods));
//        System.out.println(JSONObject.toJSONString(masterGoods));
    }
}
